<?php
	include "../controller/ConectBanco.php";
    include "../controller/Sessao.php";
	if($_SESSION["login"] != "admin"){
		header("location:../view/Principal.php");
	}
	
	$idUsuario = $_GET['idUsuario'];
	
	$queryUsuario = mysql_query("SELECT * FROM usuario WHERE idUsuario = $idUsuario")or die(mysql_error());
	$arrayUsuario = mysql_fetch_array($queryUsuario);
?>	

<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6 lt8"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7 lt8"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8 lt8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="UTF-8" />
        <!-- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">  -->
        <title>Editar Usuario</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
        <meta name="description" content="Login and Registration Form with HTML5 and CSS3" />
        <meta name="keywords" content="html5, css3, form, switch, animation, :target, pseudo-class" />
        <meta name="author" content="Codrops" />
        <link rel="shortcut icon" href="../favicon.ico"> 
        <link rel="stylesheet" type="text/css" href="../css/demo.css" />
        <link rel="stylesheet" type="text/css" href="../css/style.css" />
		
    </head>
    <body>
        <div class="container">
			<?php
				include "MenuAdmin.php";
				Menu::data();
				Menu::menuAdmin(); 
			?>
            <header>
                <h1>LOCALIZAGORA<span></br>Sistema de rastreamento via satelite </span></h1>
				
            </header>
            <section>				
                <div id="container_demo" >
                    <!-- hidden anchor to stop jump http://www.css3create.com/Astuce-Empecher-le-scroll-avec-l-utilisation-de-target#wrap4  -->
                    <div id="wrapper">
                        <div id="login" class="animate form">
                            <form  action="../controller/Editar.php?idUsuario=<?php echo $idUsuario;?>" method="post" autocomplete="on" > 
                                <h1>Editar Usuario</h1> 
                                 <p> 
                                    <label for="usernamesignup" class="uname" data-icon="u">Nome</label>
                                    <input id="usernamesignup" name="usernamesignup" required="required" value="<?php echo $arrayUsuario['nome'];?>" type="text" placeholder="meu nome" />
                                </p>
                                <p> 
                                    <label for="emailsignup" class="youmail" data-icon="e" > E-mail</label>
                                    <input id="emailsignup" name="emailsignup" required="required" value="<?php echo $arrayUsuario['email'];?>" type="email" placeholder="mysupermail@mail.com"/> 
                                </p>
								<p> 
                                    <label for="cpfsignup" class="cpf" data-icon="u" > Cpf</label>
                                    <input id="cpfsignup" name="cpfsignup" required="required" value="<?php echo $arrayUsuario['cpf'];?>" type="text" placeholder="xxxxxxxxxxx-x"/> 
                                </p>
								<p> 
                                    <label for="nascsignup" class="nasc" data-icon="u" > Data e nascimento</label>
                                    <input id="nascsignup" name="nascsignup" required="required" value="<?php echo $arrayUsuario['nasc'];?>" type="text" placeholder="xx/xx/xxxx"/> 
                                </p>
								<p> 
									<label for="sexosignup" class="sexo"  > Sexo</label>
									<select id="sexosignup" name="sexosignup" required="required">
									  <?php 
									  if($arrayUsuario['sexo'] == 'm'){
											
									  		echo " <option ></option>
									  		  	   <option value=\"m\" selected>Masculino</option>
									 	           <option value=\"f\">Feminino</option>";
									  }else{
									  		echo " <option ></option>
									  		       <option value=\"m\" >Masculino</option>
									 	           <option value=\"f\"selected>Feminino</option>";

									  }
									  ?>
									 
									</select>
                                </p>
								 <p> 
                                    <label for="loginsignup" class="login" data-icon="p">Login </label>
                                    <input id="loginsignup" name="loginsignup" required="required" value="<?php echo $arrayUsuario['login'];?>" type="text" placeholder="eg. Paulo"/>
                                </p>
                                <p> 
                                    <label for="passwordsignup" class="youpasswd" data-icon="p">Senha </label>
                                    <input id="passwordsignup" name="passwordsignup"  type="password" placeholder="eg. X8df!90EO"/>
                                </p>
								
                               <br><br>
                                <p class="button"> 
                                    <input type="submit" value="Salva" /> 
								</p>
                            </form>
                        </div>

                        
						
                    </div>
                </div>  
            </section>
        </div>
    </body>
</html>
